const fetch = require('../util/fetchUtil').fetchRequest

run()
async function run(){
    for(let i = 0; i< 200; i++){
        // await delay(2)
        let resBody = await fetch(`http://www.kuwo.cn/api/www/search/searchMusicBykeyWord?key=%E9%87%8E%E7%8B%BCdisco&pn=1&rn=30
        `)
        let res = await resBody.json()
        if(res.code === 200 && res.data){
            console.info(`第${i+1}次 -- success: ${res.data.total>0} -- ${res.data.total}`)
        }else{
            console.warn(`第${i+1}次 --${JSON.stringify(res)}`)
        }
    }
}

async function delay(s){
    return new Promise((resolve, reject)=>{
        setTimeout(resolve, s*1000)
    })
}